package cn.itsy.dao.position;

import cn.itsy.pojo.Position;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository("positionDaoimpl")
public class PositionDaoimpl implements PositionDao {
    @Resource(name = "jdbcTemplate")
    private JdbcTemplate jdbcTemplate;

    @Override
    public List<Position> queryPositionAll(String sql) {
        List<Position> query = this.jdbcTemplate.query(sql, new BeanPropertyRowMapper<Position>(Position.class));
        return query;
    }
}
